
class Person {
  //构造函数
  constructor(name) {
    this.name = name;
  }

  say() {
    console.log(this.name);
  }
}

class Student extends Person {
  constructor(name, number) {
    super(name)//指向父类的声明
    this.number = number;
  }

  hello() {
    super.say();//指向父类的方法
    console.log(this.number)
  }
}

const s = new Student('tom', 123);
s.hello();

